# 拉取 CentOS
FROM hub.c.163.com/library/centos:latest

# 维护者
MAINTAINER regan <850535450@qq.com>

# 设置 Redis 版本
ENV REDIS_VERSION 5.0.5

#添加至容器
ADD redis-5.0.5.tar.gz '/usr/local'

# 下载并编译
RUN set -x \
  && yum update -y \
  && yum install -y wget gcc gcc-c++ make perl tar \

  && cd /usr/local \
  && mv redis-$REDIS_VERSION redis \

  && cd /usr/local/redis \
  && make \
  && make -C /usr/local/redis/src install \
  && mkdir /usr/local/redis/data \

  && yum clean all

CMD ["usr/local/redis/src/redis-server","/usr/local/redis/redis.conf"]

EXPOSE 6379
